import http from "@/utils/request";

export async function login(data) {
  return await http.login("/api/user/login", data);
}

export async function getInfo() {
  return await http.get("/api/sysUser/getInfo");
}

export async function logout(param) {
  return await http.post("/api/sysUser/logout", param);
}

export async function getMenuList() {
  return await http.get("/api/sysUser/getMenuList");
}

export async function getUserList(params) {
  return await http.get("/api/user/list", params);
}

export async function addUser(params) {
  return await http.post("/api/user/add", params);
}

export async function updateUser(params) {
  return await http.put("/api/user/update", params);
}

export async function deleteUser(params) {
  return await http.delete("/api/user/delete", params);
}

export async function getRoleList() {
  return await http.get("/api/user/getRoleList");
}

export async function saveRoleAssign(params) {
  return await http.post("/api/user/saveRoleAssign", params);
}

export async function getUserRole(params) {
  return await http.getRestApi("/api/user/getUserRole", params)
}

export async function refreshTokenApi(params) {
  return await http.post("/api/sysUser/refreshToken", params)
}